package org.jeecg.modules.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.activiti.engine.repository.Model;
import org.apache.batik.transcoder.TranscoderException;
import org.jeecg.modules.dto.InAddModelDto;
import org.jeecg.modules.dto.InCopyModelDto;
import org.springframework.transaction.annotation.Transactional;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Description: 流程模板
 * @Author: jeecg-boot
 * @Date:   2023-12-01
 * @Version: V1.0
 */
public interface IActModelService extends IService<InAddModelDto> {

    IPage<Model> page(Model model, Integer pageNo, Integer pageSize);

    IPage<Model> historyPage(Model model, Integer pageNo, Integer pageSize);

    /**
     * 创建流程模板
     * @param inAddModelDto
     */
    String create(InAddModelDto inAddModelDto) throws TranscoderException, IOException;

    void modelCopy(InCopyModelDto inCopyModelDto) throws Exception;

    String deploy(String modelId, String processName);

    void exportXml(String id, HttpServletResponse response);

    String getModelXml(String id);

    @Transactional(readOnly = false)
    void updateCategory(String id, String category);

    @Transactional(readOnly = false)
    void delete(String id);
}
